export const formatToNumber = (target) => {
  return target && target !== '-' ? +target : 0;
};

export const calcITVolume = ({
  tenTrack,
  prevTenTrack,
  key,
  CATradingData,
}: {
  tenTrack: any;
  prevTenTrack: any;
  key: string;
  CATradingData: any;
}) => {
  return (
    formatToNumber(tenTrack[key]) -
    ((prevTenTrack as any) ? formatToNumber(prevTenTrack[key]) : formatToNumber(CATradingData[key]))
  );
};
